<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.Console.Templates.default.views
 * @since         CakePHP(tm) v 1.2.0.5234
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<div class="mws-panel grid_8 <?php echo $pluralVar; ?> form">

   <div class="mws-panel-header">
     <span class="mws-i-24 i-table-1"><?php printf("<?php echo __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName); ?></span>
  </div>

<div class="mws-panel-body">
<?php echo "<?php echo \$this->Form->create('{$modelClass}',array(\"class\"=>\"mws-form\")); ?>\n"; ?>
<div class="mws-form-inline">
	 
		 
<?php
		echo "\t<?php\n";
		foreach ($fields as $field) {
			/*if (strpos($action, 'add') !== false && $field == $primaryKey) {
				continue;
			} else*/if($field == "user_id") {
				echo "\t\techo \$this->Form->input('{$field}',array(\"div\"=>\"mws-form-row\",\"type\"=>\"hidden\",\"class\"=>\"mws-textinput\",\"between\"=>'<div class=\"mws-form-item large\">'));\n";
			} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
				 
				if ($field == $primaryKey) 
				echo "\t\techo \$this->Form->input('{$field}');\n";
				else
				echo "\t\techo \$this->Form->input('{$field}',array(\"div\"=>\"mws-form-row\",\"class\"=>\"mws-textinput\",\"between\"=>'<div class=\"mws-form-item large\">')).\"</div>\";\n";
				
			}
		}
		if (!empty($associations['hasAndBelongsToMany'])) {
			foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
				echo "\t\techo \$this->Form->input('{$assocName}');\n";
			}
		}
		echo "\t?>\n";
?>
	 
	</div>
	<div class="mws-button-row">
	 <input type="submit" class="mws-button orange mws-i-24 i-check large" value="<?php echo "<?php echo __('Submit'); ?>\n";
?>">
	 </div>
<?php
	echo "<?php echo \$this->Form->end(); ?>\n";
?>
</div>
</div>
<div class="actions">
	<h3><?php echo "<?php echo __('Actions'); ?>"; ?></h3>
	<ul>

<?php if (strpos($action, 'add') === false): ?>
		<li><?php echo "<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>"; ?></li>
<?php endif; ?>
		<li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?>"; ?></li>
<?php
		$done = array();
		foreach ($associations as $type => $data) {
			foreach ($data as $alias => $details) {
				if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
					echo "\t\t<li><?php echo \$this->Html->link(__('List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
					echo "\t\t<li><?php echo \$this->Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
					$done[] = $details['controller'];
				}
			}
		}
?>
	</ul>
</div>
